<div>
	<ul class="menu" id="menu">
		<?php 
			$sql = "select * from ms_module where modulename = 'home' and moduleid = 1 and modulestatus = 1 and stsrc = 'A' ";
			$exe = mysql_query($sql) or die(mysql_error());
			$row = mysql_fetch_array($exe);
			$num = mysql_num_rows($exe);
			
			if($num > 0) {
		?>
		<li>
			<a class="menulink" <?php if($uri_var[1]==""){ ?>style="background:url(../../../../source/front/img/menu_h.jpg)"<?php } ?> href="<?php echo getURLdomain(); ?>" class="menulink"><?php echo $row['modulelabel']; ?></a>
		</li>
		<?php } ?>
		<?php 
			$sql = "select * from ms_module where modulename = 'aboutus' and moduleid = 2 and modulestatus = 1 and stsrc = 'A' ";
			$exe = mysql_query($sql) or die(mysql_error());
			$row = mysql_fetch_array($exe);
			$num = mysql_num_rows($exe);
			
			if($num > 0) {
		?>
		<li>
			<a class="menulink" <?php if($uri_var[1]==$row['modulename']){ ?>style="background:url(../../../../source/front/img/menu_h.jpg)"<?php } ?> href="<?php echo getURLdomain(); ?>/<?php echo $row['moduleurlfront']; ?>" class="menulink"><?php echo $row['modulelabel']; ?></a>
		</li>
		<?php } ?>
		<?php 
			$sql = "select * from ms_module where modulename = 'product' and moduleid = 3 and modulestatus = 1 and stsrc = 'A' ";
			$exe = mysql_query($sql) or die(mysql_error());
			$row = mysql_fetch_array($exe);
			$num = mysql_num_rows($exe);
			
			if($num > 0) {
		?>
		<li>
			<a class="menulink" <?php if($uri_var[1]==$row['modulename']){ ?>style="background:url(../../../../source/front/img/menu_h.jpg)"<?php } ?> href="<?php echo getURLdomain(); ?>/<?php echo $row['moduleurlfront']; ?>" class="menulink"><?php echo $row['modulelabel']; ?></a>
			<?php 
				$sql2 = "select * from tbl_product_category where productcategorystatus = 1 and stsrc = 'A' order by productcategoryposition asc ";
				$exe2 = mysql_query($sql2) or die(mysql_error());
				$num2 = mysql_num_rows($exe2);
				
				$getbrowser = getBrowser();
				// exception for IE because jquery tinydropdown bug
				if($num2 > 0 && $getbrowser['name'] != "Internet Explorer") {
			?>
			<ul>
				<?php
					$x2 = 1;
					while($row2 = mysql_fetch_array($exe2))
					//if(1==0)
					{
						$sql3 = "select * from tbl_product_brand where productbrandstatus = 1 and productcategoryid = '".$row2['productcategoryid']."' and stsrc = 'A' order by productbrandposition asc ";
						$exe3 = mysql_query($sql3) or die(mysql_error());
						$num3 = mysql_num_rows($exe3);
				?>
				<li ><a <?php if($num3 > 0){echo "class='sub'";} ?> href="/product/<?php echo $row2['productcategoryname']; ?>"><?php echo $row2['productcategorylabel']; ?></a>
					
					<?php
						if($num3 > 0) {
					?>
					<ul>
						<?php
							$x3 = 1;
							while($row3 = mysql_fetch_array($exe3))
							{
								$sql4 = "select * from tbl_product_class where productclassstatus = 1 and productbrandid = '".$row3['productbrandid']."' and stsrc = 'A' order by productclassposition asc ";
								$exe4 = mysql_query($sql4) or die(mysql_error());
								$num4 = mysql_num_rows($exe4);
						?>
						<li <?php if($x3 == 1){echo "class='topline'";} ?>><a <?php if($num4 > 0){echo "class='sub'";} ?> href="/product/<?php echo $row2['productcategoryname']; ?>/<?php echo $row3['productbrandname']; ?>"><?php echo $row3['productbrandlabel']; ?></a>
							<?php
								if($num4 > 0) {
							?>
							<ul>
								<?php
									$x4 = 1;
									while($row4 = mysql_fetch_array($exe4))
									{
										$sql5 = "select * from tbl_product_detail where productdetailstatus = 1 and productclassid = '".$row4['productclassid']."' and stsrc = 'A' order by productdetailposition asc ";
										$exe5 = mysql_query($sql5) or die(mysql_error());
										$num5 = mysql_num_rows($exe5);
								?>
								<li <?php if($x4 == 1){echo "class='topline'";} ?>><a <?php if($num5 > 0){echo "class='sub'";} ?> href="/product/<?php echo $row2['productcategoryname']; ?>/<?php echo $row3['productbrandname']; ?>/<?php echo $row4['productclassname']; ?>"><?php echo $row4['productclasslabel']; ?></a>
									<?php
										if($num5 > 0) {
									?>
									<ul>
										<?php
											$x5 = 1;
											while($row5 = mysql_fetch_array($exe5))
											{
										?>
										<li <?php if($x5 == 1){echo "class='topline'";} ?>><a href="/product/<?php echo $row2['productcategoryname']; ?>/<?php echo $row3['productbrandname']; ?>/<?php echo $row4['productclassname']; ?>/<?php echo $row5['productdetailname']; ?>"><?php echo $row5['productdetaillabel']; ?></a></li>
								
										<?php
											$x5++;
											}
										?>
									</ul>
									<?php
										}
									?>
									</li>
								<?php
									$x4++;
									}
								?>
							</ul>
							<?php
								}
							?>
							</li>
						<?php
							$x3++;
							}
						?>
					</ul>
					<?php
						}
					?>
					</li>
				<?php
					$x2++;
					}
				?>
				<!--
				<li><a href="#" class="sub">Navigation Item 3</a>
					<ul>
						<li class="topline"><a href="#" class="sub">Navigation Item 3</a>
							<ul>
								<li class="topline"><a href="#">Navigation Item 1</a></li>
								<li><a href="#">Navigation Item 2</a></li>
								<li><a href="#">Navigation Item 3</a></li>
								<li><a href="#">Navigation Item 4</a></li>
								<li><a href="#">Navigation Item 5</a></li>
								<li><a href="#">Navigation Item 6</a></li>
							</ul>
						</li>
						<li><a href="#">Navigation Item 2</a></li>
						<li><a href="#" class="sub">Navigation Item 3</a>
							<ul>
								<li class="topline"><a href="#">Navigation Item 1</a></li>
								<li><a href="#">Navigation Item 2</a></li>
								<li><a href="#">Navigation Item 3</a></li>
								<li><a href="#">Navigation Item 4</a></li>
								<li><a href="#">Navigation Item 5</a></li>
								<li><a href="#">Navigation Item 6</a></li>
							</ul>
						</li>
						<li><a href="#">Navigation Item 4</a></li>
					</ul>
				</li>
				<li><a href="#">Navigation Item 1</a></li>
				<li><a href="#" class="sub">Navigation Item 2</a>
					<ul>
						<li class="topline"><a href="#">Navigation Item 1</a></li>
						<li><a href="#">Navigation Item 2</a></li>
						<li><a href="#">Navigation Item 3</a></li>
						<li><a href="#">Navigation Item 4</a></li>
						<li><a href="#">Navigation Item 5</a></li>
					</ul>
				</li>
				<li><a href="#" class="sub">Navigation Item 3</a>
					<ul>
						<li class="topline"><a href="#">Navigation Item 1</a></li>
						<li><a href="#">Navigation Item 2</a></li>
						<li><a href="#" class="sub">Navigation Item 3</a>
							<ul>
								<li class="topline"><a href="#">Navigation Item 1</a></li>
								<li><a href="#">Navigation Item 2</a></li>
								<li><a href="#">Navigation Item 3</a></li>
								<li><a href="#">Navigation Item 4</a></li>
								<li><a href="#">Navigation Item 5</a></li>
								<li><a href="#">Navigation Item 6</a></li>
							</ul>
						</li>
						<li><a href="#">Navigation Item 4</a></li>
					</ul>
				</li>
				<li><a href="#">Navigation Item 4</a></li>
				<li><a href="#">Navigation Item 5</a></li>
				-->
			</ul>
			<?php } ?>
		</li>
		<?php } ?>
		<?php 
			$sql = "select * from ms_module where modulename = 'howtoorder' and moduleid = 4 and modulestatus = 1 and stsrc = 'A' ";
			$exe = mysql_query($sql) or die(mysql_error());
			$row = mysql_fetch_array($exe);
			$num = mysql_num_rows($exe);
			
			if($num > 0) {
		?>
		<li>
			<a class="menulink" <?php if($uri_var[1]==$row['modulename']){ ?>style="background:url(../../../../source/front/img/menu_h.jpg)"<?php } ?> href="<?php echo getURLdomain(); ?>/<?php echo $row['moduleurlfront']; ?>" class="menulink"><?php echo $row['modulelabel']; ?></a>
		</li>
		<?php } ?>
		<?php 
			$sql = "select * from ms_module where modulename = 'article' and moduleid = 5 and modulestatus = 1 and stsrc = 'A' ";
			$exe = mysql_query($sql) or die(mysql_error());
			$row = mysql_fetch_array($exe);
			$num = mysql_num_rows($exe);
			
			if($num > 0) {
		?>
		<li>
			<a class="menulink" <?php if($uri_var[1]==$row['modulename']){ ?>style="background:url(../../../../source/front/img/menu_h.jpg)"<?php } ?> href="<?php echo getURLdomain(); ?>/<?php echo $row['moduleurlfront']; ?>" class="menulink"><?php echo $row['modulelabel']; ?></a>
		</li>
		<?php } ?>
		<?php 
			$sql = "select * from ms_module where modulename = 'faq' and moduleid = 6 and modulestatus = 1 and stsrc = 'A' ";
			$exe = mysql_query($sql) or die(mysql_error());
			$row = mysql_fetch_array($exe);
			$num = mysql_num_rows($exe);
			
			if($num > 0) {
		?>
		<li>
			<a class="menulink" <?php if($uri_var[1]==$row['modulename']){ ?>style="background:url(../../../../source/front/img/menu_h.jpg)"<?php } ?> href="<?php echo getURLdomain(); ?>/<?php echo $row['moduleurlfront']; ?>" class="menulink"><?php echo $row['modulelabel']; ?></a>
		</li>
		<?php } ?>
		<?php 
			$sql = "select * from ms_module where modulename = 'contactus' and moduleid = 7 and modulestatus = 1 and stsrc = 'A' ";
			$exe = mysql_query($sql) or die(mysql_error());
			$row = mysql_fetch_array($exe);
			$num = mysql_num_rows($exe);
			
			if($num > 0) {
		?>
		<li>
			<a class="menulink" <?php if($uri_var[1]==$row['modulename']){ ?>style="background:url(../../../../source/front/img/menu_h.jpg)"<?php } ?> href="<?php echo getURLdomain(); ?>/<?php echo $row['moduleurlfront']; ?>" class="menulink"><?php echo $row['modulelabel']; ?></a>
		</li>
		<?php } ?>
	</ul>
</div>
<script type="text/javascript">
	var menu=new menu.dd("menu");
	menu.init("menu","menuhover");
</script>